'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.createTable('edu_user_teachers', {
      id: {
        allowNull: false,
        autoIncrement: true,
        primaryKey: true,
        type: Sequelize.INTEGER.UNSIGNED,
      },
      user_id: {
        allowNull: false,
        type: Sequelize.INTEGER.UNSIGNED,
        comment: '用户ID',
      },
      teacher_status: {
        allowNull: false,
        type: Sequelize.INTEGER.UNSIGNED,
        defaultValue: 0,
        comment:
          '用户信息审核状态：0-默认（注册）,1-审核通过,2-待审核,3-审核驳回',
      },
      description: {
        allowNull: false,
        type: Sequelize.TEXT,
        defaultValue: '',
        comment: '用户信息审核不通过原因',
      },
      certificates: {
        type: Sequelize.TEXT,
        comment: '【选填】协助审核的证件，JSON数组格式的链接地址',
      },
      works: {
        type: Sequelize.TEXT,
        comment:
          '【选填】教师工作经历，JSON数组格式[{company:公司名称,industry:行业,job:岗位,start_time:开始时间,end_time:结束时间}]',
      },
      educations: {
        type: Sequelize.TEXT,
        comment:
          '【选填】教师教育经历，JSON数组格式[{school:学校名称,discipline:专业,education:学历,start_time:开始时间,end_time:结束时间}]',
      },
      honors: {
        type: Sequelize.TEXT,
        comment:
          '【选填】教师教育经历，JSON数组格式[{name:荣誉名称,discipline:详细描述,attach:JSON数组}]',
      },
      deleted_at: {
        type: Sequelize.DATE,
      },
      created_at: {
        allowNull: false,
        type: Sequelize.DATE,
      },
      updated_at: {
        allowNull: false,
        type: Sequelize.DATE,
      },
    });
  },
  async down(queryInterface, Sequelize) {
    await queryInterface.dropTable('edu_user_teachers');
  },
};
